<template>
  <div class="page-box">
    <Layout v-if="isLogin.isLogin"/>
    <Login v-else/>
  </div>
</template>

<script lang="ts" setup>

import Login from '@/view/login/Login.vue'
import {useStore} from "@/store/user";
import {useRoute} from "vue-router";

const route = useRoute();

let store = useStore();

const isLogin = reactive({
  isLogin:true
})

const reload = () => {
  isLogin.isLogin = store.isLogin
}
watch(
    () => route.params,
    (toParams, previousParams) => {
      // 对路由变化做出响应...
      reload();
    }
)
</script>
<style>

.page-box {
  background: rgb(242, 243, 245);
  height: 100vh;
}

</style>